SymPy
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
SymPy is an open-source Python library for symbolic computation. It provides computer algebra capabilities either as a standalone application, as a library to other applications, or live on the web as SymPy Livecite-ref-2[2] or SymPy Gamma.cite-ref-3[3] SymPy is simple to install and to inspect because it is written entirely in Python with few dependencies.cite-ref-homepage-4-0[4]cite-ref-joyner2012-5-0[5]cite-ref-6[6] This ease of access combined with a simple and extensible code base in a well known language make SymPy a computer algebra system with a relatively low barrier to entry.
SymPy includes features ranging from basic symbolic arithmetic to calculus, algebra, discrete mathematics, and quantum physics. It is capable of formatting the result of the computations as LaTeX code.cite-ref-homepage-4-1[4]cite-ref-joyner2012-5-1[5]
SymPy is free software and is licensed under the 3-clause BSD. The lead developers are Ondřej Čertík and Aaron Meurer. It was started in 2005 by Ondřej Čertík.cite-ref-7[7]
Contents
• Features
• Calculus
• Matrices
• Geometry
• Plotting
• Physics
• Printing
• See also
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Features
The SymPy library is split into a core with many optional modules.
Currently, the core of SymPy has around 260,000 lines of codecite-ref-openhub-8-0[8] (it also includes a comprehensive set of self-tests: over 100,000 lines in 350 files as of version 0.7.5), and its capabilities include:cite-ref-homepage-4-2[4]cite-ref-joyner2012-5-2[5]cite-ref-gede2013-9-0[9]cite-ref-rocklin2012-10-0[10]cite-ref-asif2014-11-0[11]
Core capabilities
• Basic arithmetic: *, /, +, -, **
• Simplification
• Expansion
• Functions: trigonometric, hyperbolic, exponential, roots, logarithms, absolute value, spherical harmonics, factorials and gamma functions, zeta functions, polynomials, hypergeometric, special functions, etc.
Polynomials
Calculus
Solving equations
Discrete math
Matrices
• Basic arithmetic
• Solving
Geometry
Plotting
Note, plotting requires the external Matplotlib or Pyglet module.
• Coordinate models
• Plotting Geometric Entities
• 2D and 3D
• Interactive interface
• Colors
Physics
Statistics
Combinatorics
Printing
Related projects
• SageMath: an open source alternative to Mathematica, Maple, MATLAB, and Magma (SymPy is included in Sage)
• SympyCore: another Python computer algebra systemcite-ref-16[16]
• SfePy: Software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 1D, 2D and 3D.cite-ref-17[17]
• GAlgebra: Geometric algebra module (previously sympy.galgebra).cite-ref-18[18]
• Quameon: Quantum Monte Carlo in Python.cite-ref-19[19]
• Lcapy: Experimental Python package for teaching linear circuit analysis.cite-ref-20[20]
• LaTeX Expression project: Easy LaTeX typesetting of algebraic expressions in symbolic form with automatic substitution and result computation.cite-ref-21[21]
• Symbolic statistical modeling: Adding statistical operations to complex physical models.cite-ref-22[22]
• Diofant: a fork of SymPy, started by Sergey B Kirpichevcite-ref-23[23]
Dependencies
Since version 1.0, SymPy has the mpmath package as a dependency.
There are several optional dependencies that can enhance its capabilities:
• gmpy: If gmpy is installed, SymPy's polynomial module will automatically use it for faster ground types. This can provide a several times boost in performance of certain operations.
• matplotlib: If matplotlib is installed, SymPy can use it for plotting.
• Pyglet: Alternative plotting package.
See also
References
cite-note-11. "Releases - sympy/sympy". Retrieved 14 May 2025 – via GitHub.
cite-note-22. ↑ "SymPy Live". live.sympy.org. Retrieved 2021-08-25.
cite-note-33. ↑ "SymPy Gamma". www.sympygamma.com. Retrieved 2021-08-25.
cite-note-homepage-44. ↑ "SymPy homepage". Retrieved 2014-10-13.
cite-note-66. ↑ citerefmeurersmithpaprocki-ert-k2017Meurer, Aaron; Smith, Christopher P.; Paprocki, Mateusz; Čertík, Ondřej; Kirpichev, Sergey B.; Rocklin, Matthew; Kumar, AMiT; Ivanov, Sergiu; Moore, Jason K. (2017-01-02). "SymPy: symbolic computing in Python" (PDF). PeerJ Computer Science. 3: e103. doi:10.7717/peerj-cs.103. ISSN 2376-5992.
cite-note-openhub-88. ↑ "Sympy project statistics on Open HUB". Retrieved 2014-10-13.
cite-note-gede2013-99. ↑ citerefgedepetersonnanjangudmoore2013Gede, Gilbert; Peterson, Dale L.; Nanjangud, Angadh; Moore, Jason K.; Hubbard, Mont (2013). Constrained multibody dynamics with Python: From symbolic equation generation to publication. ASME 2013 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference. American Society of Mechanical Engineers. pp. V07BT10A051. doi:10.1115/DETC2013-13470. ISBN 978-0-7918-5597-3.
cite-note-1212. ↑ "Assumptions Module — SymPy 1.4 documentation". docs.sympy.org. Retrieved 2019-07-05.
cite-note-1313. ↑ "Continuum Mechanics — SymPy 1.4 documentation". docs.sympy.org. Retrieved 2019-07-05.
cite-note-1414. ↑ "GitHub - symengine/symengine: SymEngine is a fast symbolic manipulation library, written in C++". GitHub. Retrieved 2021-08-25.
cite-note-1515. ↑ "mpmath - Python library for arbitrary-precision floating-point arithmetic". mpmath.org. Retrieved 2021-08-25.
cite-note-1616. ↑ "GitHub - pearu/sympycore: Automatically exported from code.google.com/p/sympycore". GitHub. January 2021. Retrieved 2021-08-25.
cite-note-1717. ↑ citerefdevelopersDevelopers, SfePy. "SfePy: Simple Finite Elements in Python — SfePy version: 2021.2+git.13ca95f1 documentation". sfepy.org. Retrieved 2021-08-25.
cite-note-1818. ↑ "GitHub - pygae/galgebra: Symbolic Geometric Algebra/Calculus package for SymPy". GitHub. Retrieved 2021-08-25.
cite-note-1919. ↑ "Quameon - Quantum Monte Carlo in Python". quameon.sourceforge.net. Retrieved 2021-08-25.
cite-note-2020. ↑ "Welcome to Lcapy's documentation! — Lcapy 0.76 documentation". 2021-01-16. Archived from the original on 2021-01-16. Retrieved 2021-08-25.
cite-note-2121. ↑ "LaTeX Expression project documentation — LaTeX Expression 0.3.dev documentation". mech.fsv.cvut.cz. Retrieved 2021-08-25.
cite-note-2222. ↑ "Symbolic Statistics with SymPy". ResearchGate. Retrieved 2021-08-25.
cite-note-2323. ↑ "Diofant's documentation — Diofant 0.13.0a4.dev13+g8c5685115 documentation". diofant.readthedocs.io. Retrieved 2021-08-25.
External links
• Official website
• Planet SymPy
• SymPy Tutorials Collection
• Code Repository on GitHub
• Support and development forum
• Gitter chat room